<%@page pageEncoding="UTF-8" language="java" %>
<%@ include file="/commons/global.jsp"%>
<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="Bookmark" href="favicon.ico" >
<link rel="Shortcut Icon" href="favicon.ico" />
<script type="text/javascript" src="<%=request.getContextPath()%>/static/lib/respond.min.js"></script>
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/static/lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/static/h-ui.admin/css/style.css" />
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/static/css/style.css" />
<style type="text/css">
	.table-sort tr td{
	    text-align: center;
	}
	.dataTable td.sorting_1{
		background-color: inherit;
	}
	.mt_right {
    width: 100%;
}
</style>
</head>
<body>
		<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
			<span class="c-gray en">&gt;</span>
			教学管理
			<span class="c-gray en">&gt;</span>
			课程修改 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a> </nav>
		<div class="Hui-article">
			<article class="cl pd-20">
			   <form  method="post" action="<%=request.getContextPath()%>/schedule/trainPlanUpdate" id="trainPlanForm" class="form form-horizontal" >
				<div class="mt-20">
					<table class="table table-border table-bordered table-bg table-hover table-sort">
				<thead>
					<tr class="text-c">
						<th>课程名称</th>
						<th>课程编码</th>
						<th>理论开始周</th>
						<th>理论结束周</th>
						<th>实验开始周</th>
						<th>实验结束周</th>
						<th>理论教师</th>
						<th>实验教师</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					<c:if test="${scheduleVo == null }">
						<tr>
							<td colspan="9">没有记录</td>
						</tr>
					</c:if>
					<c:if test="${scheduleVo != null }">
						<input type= "hidden" name = "scheduleId" value="${scheduleVo.id}"/>
						<tr class="text-c">
							<td><input type="text" class="input-text" value="${scheduleVo.course.name }" placeholder="" id="courseName" name="courseName" readonly></td>
							<td><input type="text" class="input-text" value="${scheduleVo.course.code }" placeholder="" id="courseCode" name="courseName" readonly></td>
							<td><input type="text" class="input-text" value="${scheduleVo.theorystartweek }" placeholder="" id="theorystartweek" name="theorystartweek" ></td>
							<td><input type="text" class="input-text" value="${scheduleVo.theoryendweek }" placeholder="" id="theoryendweek" name="theoryendweek" ></td>
							<td><input type="text" class="input-text" value="${scheduleVo.expstartweek }" placeholder="" id="expstartweek" name="expstartweek"></td>
							<td><input type="text" class="input-text" value="${scheduleVo.expendweek }" placeholder="" id="expendweek" name="expendweek" ></td>
							<td><input type="text" class="input-text" value="${scheduleVo.theoryteacher }" placeholder="" id="theoryteacher" name="theoryteacher" ></td>
							<td><input type="text" class="input-text" value="${scheduleVo.expteacher }" placeholder="" id="expteacher" name="expteacher" ></td>
							<td><button id="courseEdit" class="btn btn-primary radius" type="button"><i class="Hui-iconfont">&#xe632;</i> 保存</button></td>
						</tr>
					</c:if>
				</tbody>
			</table>
				</div>
				</form>
			</article>
		</div>
</body>
	<script type="text/javascript" src="<%=request.getContextPath()%>/static/lib/jquery/1.9.1/jquery.js"></script> 
	<script type="text/javascript" src="<%=request.getContextPath()%>/static/lib/layer/2.4/layer.js"></script> 
<%-- 	<script type="text/javascript" src="<%=request.getContextPath()%>/static/lib/icheck/jquery.icheck.min.js"></script>  --%>
	<script type="text/javascript" src="<%=request.getContextPath()%>/static/lib/jquery.validation/1.14.0/jquery.validate.js"></script> 
	<script type="text/javascript" src="<%=request.getContextPath()%>/static/lib/jquery.validation/1.14.0/validate-methods.js"></script> 
	<script type="text/javascript" src="<%=request.getContextPath()%>/static/lib/jquery.validation/1.14.0/messages_zh.js"></script> 
	<script type="text/javascript" src="<%=request.getContextPath()%>/static/h-ui/js/H-ui.js"></script> 
	<script type="text/javascript" src="<%=request.getContextPath()%>/static/h-ui.admin/js/H-ui.admin.page.js"></script> 
<script type="text/javascript">
function courseEdit(){
	var data = $("#trainPlanForm").serialize();
	$.ajax({
		url: $("#trainPlanForm").attr("action"),
		data: data,
		type: "post",
		dataType: "json",
		success: function(result){
			if(result.success){
				top.layer.open({
					icon: 1,
					content: '保存成功！',
					time: 1500
				});
				parent.layer.close(parent.index);
			}else{
				top.layer.open({
					icon: 2,
					content: '保存失败！',
					time: 1500
				});
			}
		}
	});
}

$(function(){
	/* 校验 */
	var trainPlanForm ;
	$("#courseEdit").click(function(){
		courseEdit();
		});
	});
</script>
</html>